@extends('mobile.inc.common')
@section('title')
	<title>{{$archive->title}}</title>
	<meta name="keywords" content="{{$archive->tags()->pluck('name')->implode(',')}}" />
	<meta name="description" content="{{$archive->abstract}}"/>
@endsection
@section('content')

		<div class="pet_mian">
			<!--header-->
			<header class="am-header i-top">
				<div class="am-header-left am-header-nav logo">
					<a href="">

						<img src="{{asset('mobile/images/logo.png')}}">
					</a>
				</div>

				<div class="am-header-right am-header-nav i-top-pic">
					<a href="">
						<img src="{{asset('mobile/images/fdj.png')}}">
					</a>
					<a href="">
						<img src="{{asset('mobile/images/user.png')}}">
					</a>
				</div>
			</header>
			<!--header-->
			<!--banner-->
			<div class="am-g news-c-detail" style="margin-top: 98px;">
				<h1>{{$archive->title}}</h1>
				<div class="news-content-tab">
					<dl class="tab">
						@foreach($archive->tags()->get() as $tag)
							{{--<dt style="border: solid 1px #{{$tag->background_color or '006633'}};">--}}
							<dt style="background: #0C80BA;"><a href="{{$tag->url}}">{{$tag->name}}</a></dt>
							{{--</dt>--}}
						@endforeach
					</dl>
				</div>
				
				<div class="news-c-d-time"><span>发布：</span><span class="news-c-name">@if($archive->user_id==0){{$archive->detail->author}} @else{{$archive->user->nickname}}@endif</span><em>|</em><span>时间：</span><span>{{worldTime(strtotime($archive->updated_at))}}</span></div>
				<article data-am-widget="paragraph" class="am-paragraph am-paragraph-default news-c-d-article" data-am-paragraph="{ tableScrollable: true, pureview: true }">
					{!! $content !!}
					<div class="news-c-d-article-tail">
						<p><span>作者：</span><span>@if($archive->user_id==0){{$archive->detail->author}} @else{{$archive->user->nickname}}@endif</span></p>
						<p><span>著作权归作者所有。商业转载请联系作者获得授权，非商业转载请注明出处。</span></p>
					</div>

				</article>
			</div>

			<div class=" am-g news-c-d-btn">
				<div class="am-g news-c-d-btn-content">
					<div class="am-u-sm-4">
						<button class="news-c-d-button btn-sc on"></button> 收藏
					</div>
					<div class="am-u-sm-4">
						<a class="news-c-d-button btn-pl" href="#comment"></a> 写/看评论
						<div class="pl-num"><span class="am-badge am-badge-danger am-round">
										<span href="#SOHUCS" id="changyan_count_unit"></span>
										<script type="text/javascript" src="http://assets.changyan.sohu.com/upload/plugins/plugins.count.js">
										</script>
									<span>评论</span>
							</span></div>
					</div>
					<div class="am-u-sm-4">
						<button class="news-c-d-button btn-fx -mob-share-open" ></button> 分享
					</div>
						@include('mobile.inc.share')
				</div>
				<div class="last-next-href">
					<a href="{{route('article.show', [$left->id])}}" style="float: left;"><em class="em-1"><</em>上一篇</a>
					<a href="{{route('article.show', [$right->id])}}" style="float: right;">下一篇<em class="em-2">></em></a>
				</div>

			</div>

			<div class="news-content">
				<div class="news-content-title news-c-d-title">
					<span class="news-c-d-more-logo"></span >
					<span class="news-c-d-more-word">看看其他的</span>
					<a href="{{url('article')}}">更多<em>></em></a>
				</div>
				<div data-am-widget="intro" class="am-intro am-cf am-intro-default news-content-block">
					@if($hot)
						@foreach($hot as $v)
					<div class="am-g am-intro-bd">
						<div class="am-intro-left am-u-sm-5 news-intro-left">
							<a href="{{route('article.show_m', [$v->id])}}">
								@if($v->archive_type_id==4)
								<img src="{{$v->cover}}" alt="小娜" style="width:115px;height:64px" />
									@else
								<img src="{{route('image', [trim($v->cover, '/'), '115x64'])}}" alt="小娜" />
								@endif
							</a>
						</div>
						<div class="am-intro-right am-u-sm-7 news-intro-r">
							<h2><a href="{{route('article.show_m', [$v->id])}}">{{mb_substr($v->title,0,17)}}</a></h2>
							<p>{{mb_substr($v->abstract,0,90)}}</p>

						</div>
						<div class="am-u-sm-12 news-tabs">
							<dl class="tab">
								@foreach($archive->tags()->get() as $tag)
									<dt style="background:#{{$tag->background_color or '0C80BA'}};"><a href="{{$tag->url}}">{{$tag->name}}</a></dt>
								@endforeach
							</dl>

							<button class="news-content-btn-more -mob-share-open" ></button>
							<button class="news-content-comment"><span class="has-comment"></span></button>
							@include('mobile.inc.share')
						</div>
					</div>
						@endforeach
						@endif
				</div>
			</div>
			<div id="comment">
			@include('inc.comment')
			</div>
		</div>

	<script>


		wx.config({
            debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
            appId: 'wxea895a4b5d1a401c', // 必填，公众号的唯一标识
            timestamp: "{{$share['timestamp']}}", // 必填，生成签名的时间戳
            nonceStr: '{{$share['noncestr']}}', // 必填，生成签名的随机串
            signature: '{{$share['signature']}}',// 必填，签名，见附录1
            jsApiList: [
                'onMenuShareTimeline',
                'onMenuShareAppMessage',
            ] // 必填，需要使用的JS接口列表，所有JS接口列表见附录2
        });
        wx.ready(function(){
            wx.onMenuShareAppMessage({
                title: '{{$archive->title}}', // 分享标题
                desc: '{{mb_substr($archive->abstract,0,35)}}', // 分享描述
                link: window.location.href, // 分享链接
				@if($archive->archive_type_id==4)
                imgUrl:"{{$archive->cover}}",
				@else
                imgUrl:"{{route('image', [trim($archive->cover, '/'), '300x300'])}}",
				@endif
                 // 分享图标
                type: '', // 分享类型,music、video或link，不填默认为link
                dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
                success: function () {
                    // 用户确认分享后执行的回调函数
                },
                cancel: function () {
                    // 用户取消分享后执行的回调函数
                }
            });
            wx.onMenuShareTimeline({
                title: '{{$archive->title}}', // 分享标题
                desc: '{{mb_substr($archive->abstract,0,35)}}', // 分享描述
                link: window.location.href,
				@if($archive->archive_type_id==4)
                imgUrl:"{{$archive->cover}}",
				@else
                imgUrl:"{{route('image', [trim($archive->cover, '/'), '300x300'])}}",
				@endif
                success: function () {
                    // 用户确认分享后执行的回调函数
                },
                cancel: function () {
                    // 用户取消分享后执行的回调函数
                }
            });
        });
	</script>
@endsection